<template>
  <el-radio-group v-bind="radioProps" v-on="radioEvents">
    <el-radio v-for="item in options" :key="item.value" :value="item.value">
      {{ item.label }}
    </el-radio>
  </el-radio-group>
</template>

<script lang="ts">
import { defineComponent, PropType } from 'vue';

interface Option {
  label: string;
  value: string | number;
}

export default defineComponent({
  name: 'BRadio',
  props: {
    options: {
      type: Array as PropType<Option[]>,
      required: true
    },
    radioProps: {
      type: Object as PropType<Record<string, any>>,
      default: () => ({})
    },
    radioEvents: {
      type: Object as PropType<Record<string, any>>,
      default: () => ({})
    }
  }
});
</script>
